package com.ruoyi.service.impl;

import java.util.Collections;
import java.util.List;
import java.util.Map;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.ParkingInfoMapper;
import com.ruoyi.domain.ParkingInfo;
import com.ruoyi.service.IParkingInfoService;

/**
 * 停车场信息Service业务层处理
 * 
 * @author dongdong
 * @date 2025-08-26
 */
@Service
public class ParkingInfoServiceImpl implements IParkingInfoService 
{
    @Autowired
    private ParkingInfoMapper parkingInfoMapper;

    /**
     * 查询停车场信息
     * 
     * @param id 停车场信息主键
     * @return 停车场信息
     */
    @Override
    public ParkingInfo selectParkingInfoById(Long id)
    {
        return parkingInfoMapper.selectParkingInfoById(id);
    }

    /**
     * 查询停车场信息列表
     * 
     * @param parkingInfo 停车场信息
     * @return 停车场信息
     */
    @Override
    public List<ParkingInfo> selectParkingInfoList(ParkingInfo parkingInfo)
    {
        return parkingInfoMapper.selectParkingInfoList(parkingInfo);
    }

    /**
     * 新增停车场信息
     * 
     * @param parkingInfo 停车场信息
     * @return 结果
     */
    @Override
    public int insertParkingInfo(ParkingInfo parkingInfo)
    {
        parkingInfo.setCreateTime(DateUtils.getNowDate());
        return parkingInfoMapper.insertParkingInfo(parkingInfo);
    }

    /**
     * 修改停车场信息
     * 
     * @param parkingInfo 停车场信息
     * @return 结果
     */
    @Override
    public int updateParkingInfo(ParkingInfo parkingInfo)
    {
        parkingInfo.setUpdateTime(DateUtils.getNowDate());
        return parkingInfoMapper.updateParkingInfo(parkingInfo);
    }

    /**
     * 批量删除停车场信息
     * 
     * @param ids 需要删除的停车场信息主键
     * @return 结果
     */
    @Override
    public int deleteParkingInfoByIds(Long[] ids)
    {
        return parkingInfoMapper.deleteParkingInfoByIds(ids);
    }

    /**
     * 删除停车场信息信息
     * 
     * @param id 停车场信息主键
     * @return 结果
     */
    @Override
    public int deleteParkingInfoById(Long id)
    {
        return parkingInfoMapper.deleteParkingInfoById(id);
    }

    @Override
    public List<Map<String, Object>> selectList() {
        return parkingInfoMapper.selectList();
    }

}
